<?php
require_once('inc/ThumbLib.inc.php');

class Image_Resizer
{
	
	public static function smartResize($FileName, $Width ,$Height,$NewFileName = '')
	{
	   $thumb = PhpThumbFactory::create($FileName);
       $thumb->resize($Width, $Height);
       if (!empty($NewFileName))
       {
             $thumb->save($NewFileName);	
       }
       else 
       {
       	     $thumb->save($FileName);
       }
      
	}

    public static function cropResize($FileName, $Width ,$Height,$NewFileName = '')
    {
       $thumb = PhpThumbFactory::create($FileName);
       $thumb->adaptiveResize($Width, $Height);
       if (!empty($NewFileName))
       {
             $thumb->save($NewFileName);    
       }
       else 
       {
             $thumb->save($FileName);
       }
      
    }
    
    public static function hardResize($FileName, $Width ,$Height,$NewFileName = '')
    {
       $thumb = PhpThumbFactory::create($FileName);
       $thumb->resizeHard($Width, $Height);
       if (!empty($NewFileName))
       {
             $thumb->save($NewFileName);    
       }
       else 
       {
             $thumb->save($FileName);
       }
      
    }
	
	
}